package com.project.personnel.controller;


import com.project.personnel.dao.MsgcontentMapper;
import com.project.personnel.entity.Msgcontent;
import com.project.personnel.service.MsgcontentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author diaominyh
 * @since 2022-12-12
 */
@RestController
@RequestMapping("/msgcontent")
public class MsgcontentController {
    @Resource
    MsgcontentMapper msgcontentMapper;
    @Resource
    MsgcontentService msgcontentService;

    /**
     * 查询所有的系统通知
     * @param id
     * @return
     */
    @RequestMapping("getAll")
    public List<Msgcontent> getAll(Integer id){
        return msgcontentService.getAll();
    }
    /**
     * 添加新的系统通知
     * @param msgcontent
     * @return
     */
    @GetMapping("/getMsgcontentUserAdd")
    public Boolean getMsgcontentUserAdd(@RequestBody Msgcontent msgcontent){
        return msgcontentService.save(msgcontent);
    }
}

